<?php
namespace Admin\Model;

use Think\Model;

class DimissionModel extends Model{
	public function updateUserInfo($ss, $uid, $updateData )
	{
        $r = array('d'=>NULL,'i'=>'','r'=>0);
		$where['dim_id'] = $uid;
		$wheres['user_id'] =$updateData['user_id'];
	   if($ss==''){ 
	    $map['state'] = -1;
	    $user = M("user")->where($wheres)->save($map);
	   	$ret = M('dimission')->where($where)->add( $updateData );
	      }else if($ss==1){
	    	$map['state']=2;
	    	$user = M("user")->where($wheres)->save($map);
	    	$ret = M('dimission')->where($where)->save( $updateData );
	   }else if ($ss==2){
              $ret = M('dimission')->where($where)->save( $updateData );
              $user=1;
	         }     
       if ( $ret && $user ){
				$r['r'] = 1;
	            $r['d'] = $this->where($where)->find();
	            $r['i'] = '用户信息更新成功';
			}else{
				$r['i'] ='用户信息更新失败';
			}
		return $r;
	}
}